﻿Public Class NotifyTask
    Private Sub NotifyTask_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        If Me.WindowState = FormWindowState.Minimized Then
            Me.Hide()
            NtIcon.BalloonTipTitle = "Minimized"
            NtIcon.BalloonTipText = "Hello from task bar"
            NtIcon.ShowBalloonTip(10)
        End If
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        NtIcon.BalloonTipTitle = "Timer Fire"
        NtIcon.BalloonTipText = "Hello from task bar. The Time is " + Format(Now(), "hh:mm:ss")
        NtIcon.ShowBalloonTip(4)
    End Sub

    Private Sub NtIcon_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles NtIcon.DoubleClick
        Me.Show()
        Me.WindowState = FormWindowState.Normal
    End Sub
End Class
